<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Main Controller
 *
 * @package     VisualQ Local System
 * @author      CSU OJT Students '10 - '11
 * @copyright   Copyright (c) 2010 - 2011, Bitstop Network Services, Inc.
 * @version     0.1b January 01, 2011
 */

class Main extends Controller {

    function Main()
    {
        parent::Controller();
        //$this->load->database();
    }

    function index()
    {
        $this->load->database();
        if( ! strcmp($this->db->database, '') == 0)
        {
            if( ! $this->session->userdata('id'))
            {
                redirect(base_url() . 'login/');
            }
            if(strcmp($this->session->userdata('account_type'), 'manager') == 0)
            {
                redirect(base_url() . 'manager/');
            }
            else
            {
                redirect(base_url() . 'agent/');
            }
        }
        redirect(base_url() . 'initialize/');
    }

}

/* End of file main.php */
/* Location: ./system/application/controllers/main.php */